cmake_minimum_required(VERSION 2.8)
project(dawn-redis)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")

if(NOT DEFINED PROJECT_ROOT)
        set(PROJECT_ROOT ${PROJECT_SOURCE_DIR})
        include_directories(${PROJECT_ROOT}/packages/dawn-base/sources)
        add_subdirectory(packages/dawn-base)
endif()
include_directories(sources)
include_directories(/usr/local/hiredis/include)


file (GLOB dawn_source
        "sources/*.cpp"
)
add_library(dawn-redis ${dawn_source})

set(TEST_SOURCE
        test/Test.cpp)

link_directories(/usr/local/lib)
add_executable(redis_test ${TEST_SOURCE})
target_link_libraries(redis_test dawn-redis dawnbase hiredis)

add_executable(redis_test2 test/Test2.cpp)
target_link_libraries(redis_test2 dawn-redis dawnbase hiredis)